
/*************************************************************
**    Filename  :
**
**    Author :  
**    Version :  
**    Date   :   
*************************************************************/

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "ostask.h"
#include <sys/errno.h>

int Os_TaskCreate(char *name, int priority, int options, int stackSize, OsTaskFunc_t threadEntry, int arg1, int arg2, int arg3, int arg4)
{
	pthread_t *threadId =malloc(sizeof(pthread_t));
	pthread_create(threadId, NULL, (void *)( threadEntry ),NULL); 
	return (int)threadId;
}
int Os_TaskDelayTick(int ticks)
{
	return 0;
}
int Os_TaskDelayMs(int Ms)
{
	return 0;
}

int ThreadCreate(char *name, int priority, int options, int stackSize, OsTaskFunc_t threadEntry, int arg1, int arg2, int arg3, int arg4)
{
	pthread_t *threadId =malloc(sizeof(pthread_t));

	pthread_create(threadId, NULL, (void *)( threadEntry ),(void *)arg1); 
	return (int)*threadId;
}
int Os_ThreadDelete(int tid)
{
	return 0;
}
int Os_ThreadSuspend(int tid)
{
	return 0;
}
int Os_ThreadResume(int tid)
{
	return 0;
}
int Os_ThreadSelf(void)
{
	return 0;
}
char *Os_ThreadName(int tid)
{
	return 0;
}

int Os_ThreadDelayTick(int ticks)
{
	return 0;
}
int Os_ThreadDelayMs(int Millseconds)
{
	return usleep(1000*Millseconds);
}

